package cn.iocoder.yudao.module.handguard.controller.app.userbasetable10;

import cn.iocoder.yudao.module.handguard.controller.app.userbasetable9.vo.UserBaseTable9RespVO;
import cn.iocoder.yudao.module.handguard.convert.userbasetable9.UserBaseTable9Convert;
import cn.iocoder.yudao.module.handguard.dal.dataobject.userbasetable9.UserBaseTable9DO;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;

import javax.validation.constraints.*;
import javax.validation.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.IOException;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;

import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUser;

import cn.iocoder.yudao.module.handguard.controller.app.userbasetable10.vo.*;
import cn.iocoder.yudao.module.handguard.dal.dataobject.userbasetable10.UserBaseTable10DO;
import cn.iocoder.yudao.module.handguard.convert.userbasetable10.UserBaseTable10Convert;
import cn.iocoder.yudao.module.handguard.service.userbasetable10.UserBaseTable10Service;

@Tag(name = "小程序 - 商业写字楼按揭贷款")
@RestController
@RequestMapping("/hutai/user-base-table10")
@Validated
public class UserBaseTable10Controller {

    @Resource
    private UserBaseTable10Service userBaseTable10Service;

    @PostMapping("/create")
    @Operation(summary = "创建商业写字楼按揭贷款")
    public CommonResult<Long> createUserBaseTable10(@Valid @RequestBody UserBaseTable10CreateReqVO createReqVO) {
        return success(userBaseTable10Service.createUserBaseTable10(createReqVO));
    }

    @PutMapping("/update")
    @Operation(summary = "更新商业写字楼按揭贷款")
    public CommonResult<Boolean> updateUserBaseTable10(@Valid @RequestBody UserBaseTable10UpdateReqVO updateReqVO) {
        userBaseTable10Service.updateUserBaseTable10(updateReqVO);
        return success(true);
    }



    @GetMapping("/get")
    @Operation(summary = "获得商业写字楼按揭贷款")
    public CommonResult<UserBaseTable10RespVO> getUserBaseTable10(@RequestParam("id") Long id) {
        UserBaseTable10DO userBaseTable10 = userBaseTable10Service.getUserBaseTable10(id);
        return success(UserBaseTable10Convert.INSTANCE.convert(userBaseTable10));
    }



    @GetMapping("/list")
    @Operation(summary = "获得商业写字楼按揭贷款列表")
    public CommonResult<List<UserBaseTable10RespVO>> getUserBaseTable10List(Long ui) {
        List<UserBaseTable10DO> list = userBaseTable10Service.getUserBaseTable10List(ui);
        return success(UserBaseTable10Convert.INSTANCE.convertList(list));
    }




}
